<?php
namespace app\index\validate;

use think\console\command\make\Validate;

class Admin extends Validate
{
    // 验证规则
    protected $rule = [
        'name' => 'require|email|max:25',
        'password' => 'require',
        'captcha|验证码' => 'require|captcha',
    ];
    protected $message = [
        'name.require' => '账户名不能为空',
        'name.email' => '账户需要邮箱格式',
        'name.max' => '账户名长度不能大于25位',
        'password.require' => '密码不能为空'
    ]; 

    protected $scene = [
        //登陆场景
        'login' => ['name','password','captcha'],
        //注册场景
        'register' => ['name','password','captcha','mobile']
    ];
}